package edu.gdkm.dao;

import edu.gdkm.pojo.Record;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface IRecordDao {
    @Insert("insert into record value(null,#{bid},#{sid},#{borrowtime},null)")
    @Options(useGeneratedKeys=true, keyProperty="rid", keyColumn="rid")
    public Integer insertRecord(Record record);
    @Update("update record set recordtime=#{recordtime} where rid=#{rid}")
    public Integer updateRecord(Record record);
    @Delete("delete from record where rid=#{rid}")
    public Integer delRecordByRid(Integer rid);
    @Select("select * from record where rid=#{rid}")
    public Record getRecordByRid(Integer rid);
    @Select("select * from record")
    public List<Record> getRecordList();
    @Select("select count(*) from record")
    public long getRecordCount();
}
